const App = getApp();
// 工具类
import util from '../../../utils/util';
Page({

    /**
     * 页面的初始数据
     */
    data: {
        imgUrl:App.globalData.imgUrl,
        name:"",
        phone:"",
        isData: false,
        words: {},
        user: {},
        dealer: {},
        isLoading: true,
        reLoading: false,
        role:wx.getStorageSync('role')
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad(options) {
        this.setData({
            name:options.name,
            role:wx.getStorageSync('role')
        })
      // let phone = util.starString('15542295980');
      // this.setData({
      //   phone:phone
      // })    
    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow() {
        let _this = this;
        // 获取个人信息
        _this.getMyEmptyCodeNums();
    },
    // 获取赋能记录
    getMyEmptyCodeNums() {
        let _this = this;
        App._get('User/getMyEmptyCodeNums', {}, res => {
                this.setData({
                    allCount:res.data.allCount,
                    enusedCount:res.data.enusedCount,
                    user:res.data.user
                })
        }, false, () => {
            _this.setData({
                isLoading: false,
                reLoading: false,
            })
        })
    },
    toJump(e){
        let url = e.currentTarget.dataset.url;
        wx.navigateTo({
            url: url
        });
    }

})
